<?php 

namespace app\api\validate;
use think\Validate;
class Address extends Validate
{
    protected $rule = [
        'consignee'  =>  'require|chs',
        'phone' =>  'require|number',
        'province' =>  'require',
        'city' => 'require',
        'district' =>  'require',
        'detail' =>  'require',
        'default' =>  'require|in:0,1',
    ];
    
    protected $message = [
        'consignee.require'  =>  '请输入收件人',
        'consignee.chs'  =>  '请正确输入收件人',
        'phone.require' =>  '电话号码必须输入',
        'phone.number'  =>  '请正确输入电话号码',
        'province.require' =>  '省不能为空',
        'district.require' =>  '区域不能为空',
        'city.require' =>  '城市不能为空',
        'detail.require' =>  '详细地址不能为空',
        'default.in'       =>  '默认不能为空'
    ];
    
    protected $scene = [
        'add'   =>  ['consignee','phone','province','province','city','detail'],
        'edit'  =>  ['consignee','phone','province','province','city','detail'],
    ];
}

 ?>